package distance;
import java.util.*;
public class distance{
	public double  x,y,z;
	public distance(double x,double y,double z) {
		this.x=x;
		this.y=y;
		this.z=z;
	}
	static double rtdis(distance a ,distance b) {
		return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2)+Math.pow(a.z-b.z,2));
	}
    public static void main(String args[]) {
    double x,y,z;
    try (Scanner sc = new Scanner(System.in)) {
		System.out.println("以下输入第一个点的坐标");
		System.out.println("输入长");
		x = sc.nextDouble();
		System.out.println("输入宽");
		y = sc.nextDouble();
		System.out.println("输入高");
		z = sc.nextDouble();
		distance dis1=new distance(x,y,z);
		System.out.println("X1="+dis1.x+" Y1="+dis1.y+" Z1="+dis1.z);
		System.out.println("输入长");
		x = sc.nextDouble();
		System.out.println("输入宽");
		y = sc.nextDouble();
		System.out.println("输入高");
		z = sc.nextDouble();
		distance dis2=new distance(x,y,z);
		System.out.println("X1="+dis1.x+" Y1="+dis1.y+" Z1="+dis1.z);
		System.out.println("X2="+dis2.x+" Y2="+dis2.y+" Z2="+dis2.z);
		System.out.println("两点距离为："+rtdis(dis1,dis2));
	}
    }
	}

